package homework13;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

/**
 * @author Administrator
 */
public class Task2 {
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader=new BufferedReader(new FileReader("D:\\abc.txt"));
        ArrayList<String> arrayList=new ArrayList<String>();
        String line=null;
        Random random=new Random();
        while((line=bufferedReader.readLine())!=null){
            arrayList.add(line);
        }
        int a=random.nextInt(arrayList.size());
        String s=arrayList.get(a);
        System.out.println(s);
    }
}
